const { ipcRenderer } = require('electron');
const exportBtn = document.getElementById('export');
window.onload = function () {
  document.getElementById('export').addEventListener('click', function () {
    ipcRenderer.send('exportBtn', document.getElementById('psw').value);
  });

  ipcRenderer.on('exportResult', (event, arg) => {
    console.log(arg);
    if (arg) {
      alert('导出成功!导出位置：C://fuel');
    } else {
      alert('导出失败!');
    }
  });

  document.getElementById('start').addEventListener('click', function () {
    ipcRenderer.send('start', document.getElementById('psw').value, document.getElementById('min').value, document.getElementById('startItem').value, document.getElementById('endItem').value);
  });

  ipcRenderer.on('refreshAccount', (event, ca, currentAdd, min) => {
    document.getElementById('currentItem').innerHTML = '当前第' + ca + '个钱包：' + currentAdd + ' 倒计时:' + min + '秒';
  });
};


